/**
 * Created by Administrator on 2017/6/8.
 */
import {fetch} from 'api/fetch'
export const callAuthCode = (userPhone) => {
  return fetch({
    url: '/api/user/auth/code',
    method: 'post',
    data: {
      userPhone: userPhone,
    }
  })
}
export const callAuthLogin = (userPhone, verificationCode) => {
  return fetch({
    url: '/api/user/auth/login',
    method: 'post',
    data: {
      userPhone: userPhone,
      verificationCode: verificationCode
    }
  })
}

export const callAuthLogout= () => {
  return fetch({
    url: '	/api/user/auth/logout',
    method: 'post',
    data: {

    }
  })
}

// code 换取 openId
export const callGetOpenId= (code) => {
  return fetch({
    url: '	/api/user/auth/openid',
    method: 'post',
    data: {
      code
    }
  })
}



export const callWxCode= () => {
  return fetch({
    url: 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0ee2effdfc2706e1&redirect_uri=http%3A%2F%2Frxylwx.malrro.com%2F&response_type=code&scope=snsapi_base&state=/&#wechat_redirect',
    method: 'get',
  })
}
